#include "comm.hpp"


int main()
{
       //打开文件
       int fid = open(filename, O_WRONLY | O_APPEND);
       if(fid < 0)
       {
           perror("open");
           exit(File_open_failed);
       }
   
       while(1)
       {
           //写
           std::cout << "请输入任务: ";
           std::string buffer;
           getline(std::cin, buffer);
           std::cout << "请求任务: " << buffer << std::endl;
           write(fid, buffer.c_str(), buffer.size());
       }
   
       //关闭文件
       int x = close(fid);
       if(x < 0)
       {
           perror("close");
           exit(File_close_failed);
       }
    return 0;
}